﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Manage.Master" AutoEventWireup="true" CodeBehind="MClaUpd.aspx.cs" Inherits="WebSystem.MClaUpd" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">

        .auto-style1 {
            width: 100%;
        }
        .auto-style3 {
            height: 37px;
        }
        .auto-style4 {
            height: 20px;
            text-align: right;
            width: 326px;
        }
        .auto-style5 {
            height: 20px;
            width: 176px;
        }
        .auto-style2 {
            height: 20px;
        }
        .auto-style6 {
            height: 34px;
            text-align: right;
            width: 326px;
        }
        .auto-style7 {
            height: 34px;
            width: 176px;
        }
        .auto-style8 {
            height: 34px;
        }
        .auto-style9 {
            height: 23px;
            text-align: right;
            width: 326px;
        }
        .auto-style10 {
            height: 23px;
            width: 176px;
        }
        .auto-style11 {
            height: 23px;
        }
        .auto-style12 {
            height: 33px;
            text-align: right;
            width: 326px;
        }
        .auto-style13 {
            height: 33px;
            width: 176px;
        }
        .auto-style14 {
            height: 33px;
        }
        .auto-style15 {
            height: 31px;
            text-align: right;
            width: 326px;
        }
        .auto-style16 {
            height: 31px;
            width: 176px;
        }
        .auto-style17 {
            height: 31px;
        }
        </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <p>
        &nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        </p>
    <p>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <table class="auto-style1">
                    <tr>
                        <td class="auto-style3" colspan="3" style="text-align: center">
        <asp:Button ID="Button12" runat="server" OnClick="Button4_Click" Text="增加课程" />
&nbsp;&nbsp;&nbsp;
        <asp:Button ID="Button13" runat="server" OnClick="Button5_Click" Text="删除课程" />
&nbsp;&nbsp;&nbsp;
        <asp:Button ID="Button14" runat="server" OnClick="Button6_Click" Text="修改课程" />
&nbsp;&nbsp;&nbsp;
        <asp:Button ID="Button15" runat="server" OnClick="Button7_Click" Text="显示课表" />
                        </td>
                    </tr>
                    <tr>
                        <td class="auto-style3" colspan="3" style="text-align: center">
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td class="auto-style3" colspan="3" style="text-align: center">
                            <asp:Label ID="Label1" runat="server" Font-Size="XX-Large" Text="修改课程"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td class="auto-style6">
                            <asp:Label ID="Label2" runat="server" Text="输入课程号"></asp:Label>
                        </td>
                        <td class="auto-style7">
                            <asp:TextBox ID="txtCno" runat="server"></asp:TextBox>
                        </td>
                        <td class="auto-style8">
                            <asp:Button ID="btnOut" runat="server" OnClick="btnOut_Click" style="height: 21px" Text="显示数据" ForeColor="Black" />
&nbsp;&nbsp;&nbsp;
                            <asp:Label ID="lblInfo" runat="server" ForeColor="Red"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td class="auto-style9">
                            <asp:Label ID="Label3" runat="server" Text="课程"></asp:Label>
                        </td>
                        <td class="auto-style10">
                            <asp:TextBox ID="txtCname" runat="server"></asp:TextBox>
                        </td>
                        <td class="auto-style11">
                            </td>
                    </tr>
                    <tr>
                        <td class="auto-style12">
                            <asp:Label ID="Label4" runat="server" Text="学分"></asp:Label>
                        </td>
                        <td class="auto-style13">
                            <asp:TextBox ID="txtCre" runat="server"></asp:TextBox>
                        </td>
                        <td class="auto-style14">
                            </td>
                    </tr>
                    <tr>
                        <td class="auto-style12">
                            <asp:Label ID="Label5" runat="server" Text="教师编号"></asp:Label>
                        </td>
                        <td class="auto-style13">
                            <asp:TextBox ID="txtTno" runat="server"></asp:TextBox>
                        </td>
                        <td class="auto-style14">
                            </td>
                    </tr>
                    <tr>
                        <td class="auto-style15">
                            </td>
                        <td class="auto-style16">
                            <asp:Button ID="btnUpd" runat="server" OnClick="btnUpd_Click1" Text="更新数据" />
&nbsp;&nbsp;
                            <asp:Button ID="Button11" runat="server" OnClick="Button11_Click" Text="重置" />
                        </td>
                        <td class="auto-style17">
                            </td>
                    </tr>
                    <tr>
                        <td class="auto-style4"></td>
                        <td class="auto-style5">
                            <br />
                            <asp:GridView ID="GridView1" runat="server" OnSelectedIndexChanged="btnUpd_Click" AutoGenerateColumns="False" DataKeyNames="Cno,Tno" DataSourceID="SqlDataSource2">
                                <Columns>
                                    <asp:BoundField DataField="Cno" HeaderText="课程编号" ReadOnly="True" SortExpression="Cno" />
                                    <asp:BoundField DataField="Cname" HeaderText="课程名称" SortExpression="Cname" />
                                    <asp:BoundField DataField="Credit" HeaderText="学分" SortExpression="Credit" />
                                    <asp:BoundField DataField="Tno" HeaderText="教师编号" ReadOnly="True" SortExpression="Tno" />
                                </Columns>
                            </asp:GridView>
                            <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:dhd2014115121ConnectionString %>" SelectCommand="SELECT * FROM [Course]"></asp:SqlDataSource>
                        </td>
                        <td class="auto-style2"></td>
                    </tr>
                </table>
    </p>
    <br />
    <br />
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConflictDetection="CompareAllValues" ConnectionString="<%$ ConnectionStrings:dhd2014115121ConnectionString %>" DeleteCommand="DELETE FROM [Course] WHERE [Cno] = @original_Cno AND [Tno] = @original_Tno AND (([Cname] = @original_Cname) OR ([Cname] IS NULL AND @original_Cname IS NULL)) AND (([Credit] = @original_Credit) OR ([Credit] IS NULL AND @original_Credit IS NULL))" InsertCommand="INSERT INTO [Course] ([Cno], [Cname], [Credit], [Tno]) VALUES (@Cno, @Cname, @Credit, @Tno)" OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT * FROM [Course]" UpdateCommand="UPDATE [Course] SET [Cname] = @Cname, [Credit] = @Credit WHERE [Cno] = @original_Cno AND [Tno] = @original_Tno AND (([Cname] = @original_Cname) OR ([Cname] IS NULL AND @original_Cname IS NULL)) AND (([Credit] = @original_Credit) OR ([Credit] IS NULL AND @original_Credit IS NULL))">
        <DeleteParameters>
            <asp:Parameter Name="original_Cno" Type="String" />
            <asp:Parameter Name="original_Tno" Type="String" />
            <asp:Parameter Name="original_Cname" Type="String" />
            <asp:Parameter Name="original_Credit" Type="String" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="Cno" Type="String" />
            <asp:Parameter Name="Cname" Type="String" />
            <asp:Parameter Name="Credit" Type="String" />
            <asp:Parameter Name="Tno" Type="String" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="Cname" Type="String" />
            <asp:Parameter Name="Credit" Type="String" />
            <asp:Parameter Name="original_Cno" Type="String" />
            <asp:Parameter Name="original_Tno" Type="String" />
            <asp:Parameter Name="original_Cname" Type="String" />
            <asp:Parameter Name="original_Credit" Type="String" />
        </UpdateParameters>
    </asp:SqlDataSource>
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
</asp:Content>
